/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package main;

import org.jibble.pircbot.PircBot;

/**
 * 
 *
 * @author Bapiste
 */
public class IrcBot extends PircBot {
    
    public void IrcBot() throws InterruptedException {
        
        this.setName("Asloune");
        this.setVerbose(false);
        
    }
    
    @Override
     public void onMessage(String channel, String sender,String login, String hostname, String message) {
        if (message.equalsIgnoreCase("time")) {
            String time = new java.util.Date().toString();
            sendMessage(channel, sender + ": The time is now " + time);
        }
        if(message.equalsIgnoreCase("nick")) {
            this.changeNick("Asloune");
        }
        if(message.equalsIgnoreCase("info")) {
            sendMessage(channel, sender + "Adress : " +this.getInetAddress());
            sendMessage(channel, sender + "Port : " +this.getPort());
            sendMessage(channel, sender + "Message delay : " +this.getMessageDelay());
            sendMessage(channel, sender + "Adress DCC : " +this.getDccInetAddress());
            sendMessage(channel, sender + "?? : " +this.getUsers("#MQCD"));
        }
    }
    
}